package org.example.Tool.Component;

import org.example.Forms.MainForm;
import org.example.Tool.ISelectable;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;

public class ContentPanel extends JPanel implements ISelectable {
    protected ISelectable relateComponent;

    protected JLabel background;

    protected boolean isShowing;
    public ContentPanel(){
        this(
                new Dimension(
                        MainForm.MainFormWidth - MainForm.startPoint.width,
                        MainForm.MainFormHeight - MainForm.startPoint.height
                )
        );
    }
    public ContentPanel(Dimension size){
        super();
        this.setLayout(null);
        this.setSize(size);
        this.setPreferredSize(size);
        setBackground(Color.LIGHT_GRAY);
    }


    @Override
    public boolean isSelected() {
        return isShowing;
    }

    @Override
    public void toBeSelected(boolean bool) {
        if(bool) {
            //todo
        }
        else{
            //todo
            if(relateComponent != null)
                relateComponent.toBeSelected(false);
        }
    }
}
